<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>鼠标按键</title>
  <style>
    #div1 {
      width: 100px;
      height: 100px;
      background-color: cyan;
    }
  </style>
</head>

<body>
  <div id="div1"></div>
  <script>
    var div = document.getElementById("div1")
    // 双击
    div.ondblclick = function () {
      console.log("双击事件");
    }
    // 鼠标移入
    div.onmouseenter = function () {
      console.log("鼠标移入事件");
    }
    // 鼠标移出
    div.onmouseleave = function () {
      console.log("鼠标移出事件");
    }
  </script>
</body>

</html>